import { request } from '@boeyo/portal';

export const fetchList = () => {
  return request({
    url: '/demo/list',
  });
};

/**
 * 数据总览
 * null
 */
export const fetchDataScreen = () => {
  return request({
    url: '/workbenches/dataScreen',
    method: 'GET',
  });
};

/**
 * 监测阵测点数量统计
 */
export const monitorPointStatistics = () => {
  return request({
    url: '/workbenches/monitorPointStatistics',
    method: 'GET',
  });
};

/**
 * 测点告警统计
 * null
 */
export const pointAlarmStatistics = () => {
  return request({
    url: '/workbenches/pointAlarmStatistics',
    method: 'GET',
  });
};

/**
 * 设备型号数量统计
 * null
 */
export const deviceModelStatistics = () => {
  return request({
    url: '/workbenches/deviceModelStatistics',
    method: 'GET',
  });
};

/**
 * 近期告警统计
 * null
 */
export const recentAlarmStatistics = (params = {}) => {
  return request({
    url: '/workbenches/recentAlarmStatistics',
    method: 'GET',
    params,
  });
};

/**
 * 近期国内地震信息top10
 * null
 */
export const recentEarthquakeInfo = () => {
  return request({
    url: '/workbenches/recentEarthquakeInfo',
    method: 'GET',
  });
};

/**
 * 菜单选择列表
 * null
 */
export const menuList = () => {
  return request({
    url: '/workbenches/menuList',
    method: 'GET',
  });
};

/**
 * 快捷菜单
 * null
 */
export const quickMenu = () => {
  return request({
    url: '/workbenches/quickMenu',
    method: 'GET',
  });
};

/**
 * 配置菜单
 * null
 */
export const configMenu = (data) => {
  return request({
    url: '/workbenches/configMenu',
    method: 'POST',
    data,
  });
};

/**
 * 通知公告
 * null
 */
export const notice = () => {
  return request({
    url: '/workbenches/notice',
    method: 'GET',
  });
};

export const getLicenseApi = async () => {
  try {
    return await request({
      baseURL: '/api',
      url: '/license/tenantLicense',
      method: 'get',
    });
  } catch (error) {}
};
